import request from "@/utils/request";
import { encryptedData } from "@/utils/encrypt";
import { loginRSA, tokenName } from "@/config";

/**
 * 物资(入口/出库)列表
 * @param {*} data
 * @returns
 */
export function API_goodsList(params) {
  return request({
    url: "/goods/list",
    method: "get",
    params,
  });
}

/**
 * 物资(入库)新增
 * @returns
 */
export function API_goodsCreate(data) {
  return request({
    url: "/goods/create",
    method: "post",
    data,
  });
}

/**
 * 物资(出库)新增
 * @returns
 */
export function API_goodsOut(data) {
  return request({
    url: `/goods/out/${data.code}`,
    method: "post",
    data,
  });
}

/**
 * 物资(入口/出库)修改
 * @returns
 */
export function API_goodsEdit(data) {
  return request({
    url: `/goods/edit/${data.code}`,
    method: "put",
    data,
  });
}

/**
 * 物资(入口/出库)删除
 * @returns
 */
export function API_goodsDelete(data) {
  return request({
    url: `/goods/delete/${data.code}`,
    method: "delete",
    data,
  });
}

/**
 * 物资(入口/出库)记录
 * @returns
 */
export function API_goodsGet(params) {
  return request({
    url: "/goods/get",
    method: "get",
    params,
  });
}
